<!DOCTYPE html>
<html>
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width,initial-scale=1,minimum-scale=1,maximum-scale=1,user-scalable=no" />
    <link rel="stylesheet" type="text/css" href="css/list.css"/>
    <script type="text/javascript" src="js/jquery.1.9.1.js" ></script>
    <script type="text/javascript" src="js/mobileSelect.js"></script>
	<link rel="stylesheet" type="text/css" href="css/mobileSelect.css"/>
	<script type="text/javascript" src="js/rem.js" ></script>
    <title>分公司现金日记账</title>
</head>
<body>
<div class="container">
	<div class="listtop">
		<div class="top_con1">
			<p class="year">2019年</p>
			<div>
				<span class="jiantou"></span>
				<div id="trigger4" class="trigger4" style="display: inline-block;">
					请选择
				</div>
				 <input type="hidden" name="" id="week" value="" />								
			</div>
		</div>
		<div class="top_con2">
			<p>收入</p>
			<p>54253</p>
		</div>
		<div class="top_con3">
			<p>支出</p>
			<p>54253</p>
		</div>
	</div>
	<ul class="list">
		<a href="#">
		<li>
			<div class="title">
				<p>2019-12-19 星期二</p>
				<p>
					<span class="chu">支出</span>4548671.11<br />
					<span class="shou">收入</span>66122211.78
				</p>
			</div>
			<div class="info">
				<p>备用金<span>54,151.23</span></p>
				<p>租车费<span>-54,151.23</span></p>
				<p>租车费<span>-54,151.23</span></p>
			</div>
		</li>
		</a>
		<a href="#">
		<li>
			<div class="title">
				<p>2019-12-19 星期二</p>
				<p>
					<span class="chu">支出</span>411.11<br />
					<span class="shou">收入</span>11.78
				</p>
			</div>
			<div class="info">
				<p>备用金<span>54,151.23</span></p>
				<p>租车费<span>-54,151.23</span></p>
				<p>租车费<span>-54,151.23</span></p>
			</div>
		</li>
		</a>
	</ul>
	<a href="add.html" class="addbutton">新增</a>
</div>
</body>
<script>
	var mobileSelect4 = new MobileSelect({
	    trigger: '#trigger4',
	    title: '地区选择',
	    wheels: [{data:[
	    					{
                            id:'1',
                            value:'',
                            childs:[
                                {id:'A1',value:''},
                            ]
                        }
	    			]}],
		 transitionEnd:function(indexArr, data){
		        
		 },
		 callback:function(indexArr, data){
		 	$('.year').text(data[0].name);
		 	var strs = data[1].name.split(",");
		 	$('#trigger4').text(strs[0]);
		    $('#week').val(data[1].value);
		 }
	});
	var arr = [];
  	$.ajax({
	  url: 'https://oa.fc62.com/api/ajax/year?num=5',
	  type: 'get',
	  success: function (year) {
	  		$.each(year.data,function (index,value) {
	  			 arr[index] = value;
	  			$.get('https://oa.fc62.com/api/ajax/year?year='+value.value,function (week) {
						arr[index]['childs'] = week.data;
					});

		   });
//		   console.log(arr);
		   mobileSelect4.updateWheels(arr);
		   
	  }
	});
</script>
</html>
